<template>
  <div class="footer">
    <div class="item" @click.stop="handleClick('home')">
      <img
        v-if="type === 'home'"
        src="@/assets/img/icon-home-h@2x.png"
        alt=""
      />
      <img v-else src="@/assets/img/icon-home-n@2x.png" alt="" />
      <span>首页</span>
    </div>
    <div class="item" @click.stop="handleClick('study')">
      <img
        v-if="type === 'study'"
        src="@/assets/img/icon-study-h@2x.png"
        alt=""
      />
      <img v-else src="@/assets/img/icon-study-n@2x.png" alt="" /><span
        >在学</span
      >
    </div>
    <div class="item" @click.stop="handleClick('member')">
      <img
        v-if="type === 'member'"
        src="@/assets/img/icon-me-h@2x.png"
        alt=""
      />
      <img v-else src="@/assets/img/icon-me-n@2x.png" alt="" /><span>我的</span>
    </div>
  </div>
</template>

<script>
export default {
  props: ["type"],
  components: {},
  data() {
    return {};
  },
  computed: {},
  watch: {},
  methods: {
    handleClick: function (name) {
      if(window.location.href !== `http://localhost:8080/study#/${name}`){
      // if(window.location.href !== `1.117.116.8/#/${name}`){
        this.$router.push({
          name,
        });
      }else{
        return
      }
    },
  },
  created() {
  },
  mounted() {},
  beforeCreate() {}, 
  beforeMount() {}, 
  beforeUpdate() {}, 
  updated() {}, 
  beforeDestroy() {}, 
  destroyed() {}, 
  activated() {}, 
};
</script>
<style lang='less' scoped>
.footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: 53px;
  background: #ffffff;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  padding: 5px 50px;
  .item {
    height: 53px;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    img {
      width: 28px;
      height: 28px;
      margin-bottom: 3px;
    }
    span {
      height: 11px;
      font-size: 11px;
      font-weight: 400;
      color: #333333;
      line-height: 11px;
      text-align: center;
    }
  }
}
</style>